﻿<%@ Page Title="Carrinho Compras - Busca" Language="C#" MasterPageFile="~/Default.Master"
    CodeBehind="CarrinhoCompras.aspx.cs" Buffer="true" Inherits="SisEagle.View.Web.Pedidos.CarrinhoCompras" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="~/UserControl/UcFormasPagamento.ascx" TagName="ucFormasPagamentos"
    TagPrefix="uc" %>
<%@ Register src="../UserControl/UsFuncionario.ascx" tagname="UsFuncionario" tagprefix="uc1" %>
<%@ Register src="../UserControl/UsCliente.ascx" tagname="UsCliente" tagprefix="uc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script src="../Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div>
        <div class="titulos_modulosBusca">
            Carrinho Compras - Busca
        </div>
        <div id="filtros_busca">
            <div id="filtros_busca_topo">
            </div>
            <div id="filtros_busca_meio">
                <%--Campos de busca de maior interesse--%>
                <div style="width: 830px; margin: 0 auto;">
                    <table style="width: 100%;">
                        <tr>
                            <td>
                                Codigo:
                            </td>
                            <td>
                                <asp:TextBox ID="txtCodigo" runat="server" ClientIDMode="Static" Width="70px" />
                            </td>
                            <td>
                                Funcionario:
                            </td>
                            <td>
                                <uc1:UsFuncionario ID="UsFuncionario" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 47px;">
                                    Cliente.:
                                </td>
                                <td colspan="3">
                                    <uc2:UsCliente ID="UsCliente" runat="server" />
                                </td>
                        </tr>
                    </table>
                    <%--Campos de busca  avançados--%>
                    <div id="filtros_avancados" style="width: 830px; margin: 4px auto; display: none;">
                        <table>
                            <tr>
                                <td style="width: 47px;">
                                   Forma Pagamento
                                </td>
                                <td>
                                    <uc:ucFormasPagamentos ID="UcCmbFormasPagamentos" runat="server" />
                                </td>
                                <td>
                                    
                                </td>
                                <td>
                                   <asp:TextBox ID="txtCodVenda" runat="server" ClientIDMode="Static" 
                                    Width="245px" Visible="False" />
                                </td>
                            </tr>
                        </table>
                    </div>
                    <%--Botoes de Busca--%>
                    <div class="Botoes_Busca">
                        <div style="float: left; width: 99px;">
                            <asp:HyperLink ID="ImageNovo" runat="server" ImageUrl="../imagens/botoes/btn_novo.png"
                                ClientIDMode="Static" NavigateUrl="~/Pedidos/CarrinhoCompra.aspx" />
                        </div>
                        <div style="float: left; width: 99px; margin-left: 5px;">
                            <asp:ImageButton ID="btnLocalizar" runat="server" ClientIDMode="Static" ImageUrl="../imagens/sistema/botoes/btn_buscar.png" />
                        </div>
                        <div style="float: left; width: 92px; margin-left: 5px;">
                            <asp:ImageButton ID="btnLimpar" runat="server" ClientIDMode="Static" ImageUrl="~/imagens/sistema/botoes/btn_limpar.png"
                                OnClientClick="LimpaCamposBusca()" CausesValidation="False" EnableViewState="False"
                                ViewStateMode="Disabled" />
                        </div>
                    </div>
                    <%-- Fim Botoes de Busca--%>
                </div>
                <div id="avanco" style="height: 32px; width: 135px; float: right; cursor: pointer;
                    margin-top: -26px; margin-right: 34px;" onclick="filtros_adv('#filtros_avancados');">
                    <div style="width: 20px; height: 19px; float: left;">
                        <img id="ImageFiltrosAvancados" alt="Filtros avançados" runat="server" src="../imagens/sistema/add_filtros.png" />
                    </div>
                    <div style="float: left; width: 100px; padding-top: 3px; margin-left: 8px;">
                        Filtros adicionais
                    </div>
                </div>
            </div>
            <div id="filtros_busca_rodape">
            </div>
        </div>
        <br />
        <%--Grid de resultado da busca--%>
        <div class="grid_generico">
            <asp:UpdatePanel ID="UpdateGridCarrinhosCompras" runat="server">
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="btnLocalizar" EventName="Click" />
                </Triggers>
                <ContentTemplate>
                    <asp:GridView ID="gridPedidos" runat="server" Width="870px" BackColor="AliceBlue"
                        AllowPaging="True" AutoGenerateColumns="False" PageSize="5" AllowSorting="True"
                        BorderWidth="2px" CellPadding="2" CellSpacing="2" BorderColor="Silver" Font-Size="13px"
                        HeaderStyle-BackColor="BurlyWood" PagerSettings-Mode="NextPreviousFirstLast"
                        AlternatingRowStyle-BackColor="Silver" HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                        HeaderStyle-Width="170px" PagerSettings-Position="Bottom" PagerSettings-NextPageImageUrl="~/App_Themes/Default/imagens/grid/proxima_pagina.png"
                        PagerSettings-FirstPageImageUrl="~/App_Themes/Default/imagens/grid/primeira_pagina.png"
                        PagerSettings-LastPageImageUrl="~/App_Themes/Default/imagens/grid/ultima_pagina.png"
                        
                        PagerSettings-PreviousPageImageUrl="~/App_Themes/Default/imagens/grid/pagina_anterior.png" 
                        onrowdatabound="gridPedidos_RowDataBound">
                        <AlternatingRowStyle BackColor="Silver"></AlternatingRowStyle>
                        <Columns>
                            <asp:TemplateField HeaderText="Codigo">
                                <ItemTemplate>
                                    <asp:Label ID="lblCodCarrinhoCompra" runat="server" 
                                        Text='<%# Bind("CodCarrinhoCompras") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox2" runat="server" 
                                        Text='<%# Bind("CodCarrinhoCompras") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <HeaderStyle Width="10%" />
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="Funcionario" DataField="NomeFuncionario" />
                            <asp:BoundField HeaderText="Cliente" DataField="NomeCliente" />
                            <asp:BoundField HeaderText="Forma Pagamento" DataField="DescricaoFormaPagamento" />
                            <asp:TemplateField AccessibleHeaderText="Clique Aqui para Editar" FooterText="Editar"
                                HeaderText="Editar">
                                <ItemTemplate>
                                    <asp:HyperLink ID="HyperEditar" Text="Editar" runat="server" ImageUrl="~/imagens/sistema/botoes/btn_editar.png"
                                        NavigateUrl='<%# "CarrinhoCompra.aspx?cod=" + Eval("CodCarrinhoCompras")%>' />
                                </ItemTemplate>
                                <HeaderStyle Width="5%" />
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Continuar Venda">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:ImageButton ID="imgVender" runat="server" 
                                        ImageUrl="~/imagens/selecionar_item.gif" />
                                </ItemTemplate>
                                <HeaderStyle Width="5%" />
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:TemplateField>
                        </Columns>
                        <HeaderStyle BackColor="BurlyWood" HorizontalAlign="Center" Width="170px" />
                        <PagerSettings FirstPageImageUrl="~/App_Themes/Default/imagens/grid/primeira_pagina.png" 
                            LastPageImageUrl="~/App_Themes/Default/imagens/grid/ultima_pagina.png" 
                            Mode="NextPreviousFirstLast" 
                            NextPageImageUrl="~/App_Themes/Default/imagens/grid/proxima_pagina.png" 
                            PreviousPageImageUrl="~/App_Themes/Default/imagens/grid/pagina_anterior.png" />
                    </asp:GridView>
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    </div>
    <%-- Fim Grid de resultado da busca--%>
    <div id="mensagemRegistros">
        <table style="margin: 0 auto">
            <tr>
                <td>
                    <img src="<%=ResolveUrl("~/imagens/sistema/alert_grid.png") %>" alt="alerta" />
                </td>
                <td>
                    A consulta é limitada a 100 registros. Caso o resultado não esteja satisfatório,
                    refine os filtros de sua busca.
                </td>
            </tr>
        </table>
    </div>
    </div>
</asp:Content>
